﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Atendex.Dominio.ActiveRecord;
using Atendex.Dominio.Interfaces;
using Castle.ActiveRecord;

namespace Atendex.Dominio.ActiveRecord
{
    [ActiveRecord(DiscriminatorValue = "curso")]
    [Serializable]
    public class CursoAR : AreaAR, ICurso
    {
        private CursoAR() { }

        public CursoAR(string nome, IList<IResponsavel> responsaveis)
        {
            Nome = nome;
            Responsaveis = responsaveis;
            Ativa = true;
        }

        [HasMany(typeof(ResponsavelAR), Table = "responsavel_area", ColumnKey = "Area", Cascade = ManyRelationCascadeEnum.All)]
        public IList<IResponsavel> Responsaveis { get; set; }
    }
}